home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / CADSP 1.0 / Messenger Classes / CADSP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-30  |  1.4 KB  |  74 lines  |  [TEXT/KAHL]

  1. /***
  2.  * CADSP
  3.  *
  4.  *        AppleTalk Data Stream Protocol handler
  5.  *
  6.  *        ask this object to handle connections over appletalk
  7.  *
  8.  *        Copyright © 1992 Bernard Bernstein. All rights reserved.
  9.  ***/ 
  10.  
  11. #pragma once
  12.  
  13. #include <CObject.h>
  14. #include <ADSP.h>
  15.  
  16. #define uPtr        unsigned char *
  17.  
  18. class CADSP : public CObject {
  19.     
  20. public:
  21.  
  22.  
  23. protected:
  24.  
  25.             /* allocate and deallocate stuff */
  26.  
  27.     void    IADSP(short queueSize, short dataSize);
  28.     void    Dispose(void);
  29.  
  30.  
  31.             /* accessing stuff */
  32.     short    DSPioResult(void);
  33.     
  34.  
  35.             /* establishing and terminating connection */
  36.  
  37.     void    DSPInit(short *socket);
  38.     void    DSPOptions(short sendBlocking, short badSeqMax, char useCheckSum);
  39.     void    DSPOpen(AddrBlock addr, unsigned char ocMode);
  40.     void    DSPClose(void);
  41.     void    DSPRemove(void);
  42.  
  43.  
  44.             /* maintaining a connection */
  45.  
  46.     void    DSPStatus(short *sendPending, short *sendAvail, 
  47.                         short *recvPending, short *recvAvail);
  48.     void    DSPRead(void *buffer, short amountToRead, short *amountRead);
  49.     void    DSPWrite(void *buffer, short amountToWrite);
  50.  
  51.  
  52. private:
  53.  
  54.     Boolean        initialized;
  55.     Boolean        opened;
  56.  
  57.     short        itsDspRefNum;            // driver reference num
  58.     short        itsQueueSize;            // size of internal queue
  59.  
  60.     DSPPBPtr    itsDsppb;                // the parameter block for ADSP
  61.  
  62.     // pointers owned by ADSP
  63.     Ptr            dspRecvQ;
  64.     Ptr            dspSendQ;
  65.     Ptr            dspAttnBuf;
  66.     Ptr            itsInBuf;
  67.     Ptr            itsOutBuf;
  68.     Ptr            itsAttnBuf;
  69.  
  70.     TPCCB        itsCcb;                    // the CCB (owned by ADSP)
  71.  
  72. };
  73.  
  74.